package com.qzw.security.service.entity;

import com.qzw.common.service.BaseEntity;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.ManyToMany;
import java.util.Set;

@Getter
@Setter
@ToString
@Entity
public class SysPermission extends BaseEntity<Integer> {

    @Column(nullable = false, unique = true)
    private String permission;

    @ManyToMany(mappedBy = "permissions")
    private Set<SysMenu> menus;

    @ManyToMany(mappedBy = "permissions")
    private Set<SysResource> resources;
}
